$(function(){
	$('a.btn-success,a.btn-danger,a.btn-warning,a.js_internal').click(function(){
		var obj = $(this);
		var isAudit = obj.attr("isAudit");
		var title = obj.attr("title");
		var label = obj.attr("label");
		parent.window.Confirm(title, label, function(){
			window.parent.$('#js_submit').button('loading');
			window.parent.$.get(obj.attr("ref"), {isAudit:isAudit}, function(res){
				window.parent.$('#js_submit').button('reset');
				if(res.status == 'ok'){
					success(res.message);
					setTimeout(window.location.reload(),1000);
				}else{
					error(res.message);
					setTimeout(window.location.reload(),1000);
				}
			}); 
		});
	});
	
});